﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace Jinshiyu.Models
{

    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "当前密码")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(10, ErrorMessage = "{0}至少需要有{2}位字符", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "新密码")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认新密码")]
        [Compare("NewPassword", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required]
        [Display(Name = "手机号")]
        public string UserName { get; set; }

        [Required(ErrorMessage="请输入密码")]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [Display(Name = "记住用户名")]
        public bool RememberMe { get; set; }
    }

    public class GetValidateCodeModel
    {
        [Required(ErrorMessage="请填写您的手机号作为用户名")]
        [StringLength(11, MinimumLength = 11, ErrorMessage = "手机号码格式有误，请重新填写")]
        [Display(Name = "手机号")]
        public string UserName { get; set; }
    }

    public class RegisterModel
    {
        [Required(ErrorMessage = "请填写您的手机号作为用户名")]
        [StringLength(11, MinimumLength = 11, ErrorMessage = "手机号码格式有误，请重新填写")]
        [Display(Name = "手机号")]
        public string UserName { get; set; }

        [Required]
        [Display(Name = "验证码")]
        public string ValidateCode { get; set; }

        [Required]
        [StringLength(10, ErrorMessage = "{0}至少需要有{2}位字符", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }
    }
}
